<?php


/**
 * Base class that represents a query for the 'evaluations' table.
 *
 *
 *
 * @method EmpevalEvaluationsQuery orderById($order = Criteria::ASC) Order by the id column
 * @method EmpevalEvaluationsQuery orderByDbOrder($order = Criteria::ASC) Order by the db_order column
 * @method EmpevalEvaluationsQuery orderByWeight($order = Criteria::ASC) Order by the weight column
 * @method EmpevalEvaluationsQuery orderByCode($order = Criteria::ASC) Order by the code column
 * @method EmpevalEvaluationsQuery orderByDescPl($order = Criteria::ASC) Order by the desc_pl column
 * @method EmpevalEvaluationsQuery orderByDescEn($order = Criteria::ASC) Order by the desc_en column
 * @method EmpevalEvaluationsQuery orderByType($order = Criteria::ASC) Order by the type column
 * @method EmpevalEvaluationsQuery orderByLastModified($order = Criteria::ASC) Order by the last_modified column
 * @method EmpevalEvaluationsQuery orderByCreated($order = Criteria::ASC) Order by the created column
 *
 * @method EmpevalEvaluationsQuery groupById() Group by the id column
 * @method EmpevalEvaluationsQuery groupByDbOrder() Group by the db_order column
 * @method EmpevalEvaluationsQuery groupByWeight() Group by the weight column
 * @method EmpevalEvaluationsQuery groupByCode() Group by the code column
 * @method EmpevalEvaluationsQuery groupByDescPl() Group by the desc_pl column
 * @method EmpevalEvaluationsQuery groupByDescEn() Group by the desc_en column
 * @method EmpevalEvaluationsQuery groupByType() Group by the type column
 * @method EmpevalEvaluationsQuery groupByLastModified() Group by the last_modified column
 * @method EmpevalEvaluationsQuery groupByCreated() Group by the created column
 *
 * @method EmpevalEvaluationsQuery leftJoin($relation) Adds a LEFT JOIN clause to the query
 * @method EmpevalEvaluationsQuery rightJoin($relation) Adds a RIGHT JOIN clause to the query
 * @method EmpevalEvaluationsQuery innerJoin($relation) Adds a INNER JOIN clause to the query
 *
 * @method EmpevalEvaluationsQuery leftJoinEmployeeEvaluations($relationAlias = null) Adds a LEFT JOIN clause to the query using the EmployeeEvaluations relation
 * @method EmpevalEvaluationsQuery rightJoinEmployeeEvaluations($relationAlias = null) Adds a RIGHT JOIN clause to the query using the EmployeeEvaluations relation
 * @method EmpevalEvaluationsQuery innerJoinEmployeeEvaluations($relationAlias = null) Adds a INNER JOIN clause to the query using the EmployeeEvaluations relation
 *
 * @method EmpevalEvaluationsQuery leftJoinEmployeeEvaluationValues($relationAlias = null) Adds a LEFT JOIN clause to the query using the EmployeeEvaluationValues relation
 * @method EmpevalEvaluationsQuery rightJoinEmployeeEvaluationValues($relationAlias = null) Adds a RIGHT JOIN clause to the query using the EmployeeEvaluationValues relation
 * @method EmpevalEvaluationsQuery innerJoinEmployeeEvaluationValues($relationAlias = null) Adds a INNER JOIN clause to the query using the EmployeeEvaluationValues relation
 *
 * @method EmpevalEvaluations findOne(PropelPDO $con = null) Return the first EmpevalEvaluations matching the query
 * @method EmpevalEvaluations findOneOrCreate(PropelPDO $con = null) Return the first EmpevalEvaluations matching the query, or a new EmpevalEvaluations object populated from the query conditions when no match is found
 *
 * @method EmpevalEvaluations findOneById(int $id) Return the first EmpevalEvaluations filtered by the id column
 * @method EmpevalEvaluations findOneByDbOrder(int $db_order) Return the first EmpevalEvaluations filtered by the db_order column
 * @method EmpevalEvaluations findOneByWeight(int $weight) Return the first EmpevalEvaluations filtered by the weight column
 * @method EmpevalEvaluations findOneByCode(string $code) Return the first EmpevalEvaluations filtered by the code column
 * @method EmpevalEvaluations findOneByDescPl(string $desc_pl) Return the first EmpevalEvaluations filtered by the desc_pl column
 * @method EmpevalEvaluations findOneByDescEn(string $desc_en) Return the first EmpevalEvaluations filtered by the desc_en column
 * @method EmpevalEvaluations findOneByType(int $type) Return the first EmpevalEvaluations filtered by the type column
 * @method EmpevalEvaluations findOneByLastModified(string $last_modified) Return the first EmpevalEvaluations filtered by the last_modified column
 * @method EmpevalEvaluations findOneByCreated(string $created) Return the first EmpevalEvaluations filtered by the created column
 *
 * @method array findById(int $id) Return EmpevalEvaluations objects filtered by the id column
 * @method array findByDbOrder(int $db_order) Return EmpevalEvaluations objects filtered by the db_order column
 * @method array findByWeight(int $weight) Return EmpevalEvaluations objects filtered by the weight column
 * @method array findByCode(string $code) Return EmpevalEvaluations objects filtered by the code column
 * @method array findByDescPl(string $desc_pl) Return EmpevalEvaluations objects filtered by the desc_pl column
 * @method array findByDescEn(string $desc_en) Return EmpevalEvaluations objects filtered by the desc_en column
 * @method array findByType(int $type) Return EmpevalEvaluations objects filtered by the type column
 * @method array findByLastModified(string $last_modified) Return EmpevalEvaluations objects filtered by the last_modified column
 * @method array findByCreated(string $created) Return EmpevalEvaluations objects filtered by the created column
 *
 * @package    propel.generator.empeval.om
 */
abstract class EmpevalBaseEvaluationsQuery extends ModelCriteria
{
    /**
     * Initializes internal state of EmpevalBaseEvaluationsQuery object.
     *
     * @param     string $dbName The dabase name
     * @param     string $modelName The phpName of a model, e.g. 'Book'
     * @param     string $modelAlias The alias for the model in this query, e.g. 'b'
     */
    public function __construct($dbName = 'vgp_empeval', $modelName = 'EmpevalEvaluations', $modelAlias = null)
    {
        parent::__construct($dbName, $modelName, $modelAlias);
    }

    /**
     * Returns a new EmpevalEvaluationsQuery object.
     *
     * @param     string $modelAlias The alias of a model in the query
     * @param     EmpevalEvaluationsQuery|Criteria $criteria Optional Criteria to build the query from
     *
     * @return EmpevalEvaluationsQuery
     */
    public static function create($modelAlias = null, $criteria = null)
    {
        if ($criteria instanceof EmpevalEvaluationsQuery) {
            return $criteria;
        }
        $query = new EmpevalEvaluationsQuery();
        if (null !== $modelAlias) {
            $query->setModelAlias($modelAlias);
        }
        if ($criteria instanceof Criteria) {
            $query->mergeWith($criteria);
        }

        return $query;
    }

    /**
     * Find object by primary key.
     * Propel uses the instance pool to skip the database if the object exists.
     * Go fast if the query is untouched.
     *
     * <code>
     * $obj  = $c->findPk(12, $con);
     * </code>
     *
     * @param mixed $key Primary key to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return   EmpevalEvaluations|EmpevalEvaluations[]|mixed the result, formatted by the current formatter
     */
    public function findPk($key, $con = null)
    {
        if ($key === null) {
            return null;
        }
        if ((null !== ($obj = EmpevalEvaluationsPeer::getInstanceFromPool((string) $key))) && !$this->formatter) {
            // the object is alredy in the instance pool
            return $obj;
        }
        if ($con === null) {
            $con = Propel::getConnection(EmpevalEvaluationsPeer::DATABASE_NAME, Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        if ($this->formatter || $this->modelAlias || $this->with || $this->select
         || $this->selectColumns || $this->asColumns || $this->selectModifiers
         || $this->map || $this->having || $this->joins) {
            return $this->findPkComplex($key, $con);
        } else {
            return $this->findPkSimple($key, $con);
        }
    }

    /**
     * Find object by primary key using raw SQL to go fast.
     * Bypass doSelect() and the object formatter by using generated code.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return   EmpevalEvaluations A model object, or null if the key is not found
     * @throws   PropelException
     */
    protected function findPkSimple($key, $con)
    {
        $sql = 'SELECT ID, DB_ORDER, WEIGHT, CODE, DESC_PL, DESC_EN, TYPE, LAST_MODIFIED, CREATED FROM evaluations WHERE ID = :p0';
        try {
            $stmt = $con->prepare($sql);
            $stmt->bindValue(':p0', $key, PDO::PARAM_INT);
            $stmt->execute();
        } catch (Exception $e) {
            Propel::log($e->getMessage(), Propel::LOG_ERR);
            throw new PropelException(sprintf('Unable to execute SELECT statement [%s]', $sql), $e);
        }
        $obj = null;
        if ($row = $stmt->fetch(PDO::FETCH_NUM)) {
            $obj = new EmpevalEvaluations();
            $obj->hydrate($row);
            EmpevalEvaluationsPeer::addInstanceToPool($obj, (string) $key);
        }
        $stmt->closeCursor();

        return $obj;
    }

    /**
     * Find object by primary key.
     *
     * @param     mixed $key Primary key to use for the query
     * @param     PropelPDO $con A connection object
     *
     * @return EmpevalEvaluations|EmpevalEvaluations[]|mixed the result, formatted by the current formatter
     */
    protected function findPkComplex($key, $con)
    {
        // As the query uses a PK condition, no limit(1) is necessary.
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKey($key)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->formatOne($stmt);
    }

    /**
     * Find objects by primary key
     * <code>
     * $objs = $c->findPks(array(12, 56, 832), $con);
     * </code>
     * @param     array $keys Primary keys to use for the query
     * @param     PropelPDO $con an optional connection object
     *
     * @return PropelObjectCollection|EmpevalEvaluations[]|mixed the list of results, formatted by the current formatter
     */
    public function findPks($keys, $con = null)
    {
        if ($con === null) {
            $con = Propel::getConnection($this->getDbName(), Propel::CONNECTION_READ);
        }
        $this->basePreSelect($con);
        $criteria = $this->isKeepQuery() ? clone $this : $this;
        $stmt = $criteria
            ->filterByPrimaryKeys($keys)
            ->doSelect($con);

        return $criteria->getFormatter()->init($criteria)->format($stmt);
    }

    /**
     * Filter the query by primary key
     *
     * @param     mixed $key Primary key to use for the query
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByPrimaryKey($key)
    {

        return $this->addUsingAlias(EmpevalEvaluationsPeer::ID, $key, Criteria::EQUAL);
    }

    /**
     * Filter the query by a list of primary keys
     *
     * @param     array $keys The list of primary key to use for the query
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByPrimaryKeys($keys)
    {

        return $this->addUsingAlias(EmpevalEvaluationsPeer::ID, $keys, Criteria::IN);
    }

    /**
     * Filter the query on the id column
     *
     * Example usage:
     * <code>
     * $query->filterById(1234); // WHERE id = 1234
     * $query->filterById(array(12, 34)); // WHERE id IN (12, 34)
     * $query->filterById(array('min' => 12)); // WHERE id > 12
     * </code>
     *
     * @param     mixed $id The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterById($id = null, $comparison = null)
    {
        if (is_array($id) && null === $comparison) {
            $comparison = Criteria::IN;
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::ID, $id, $comparison);
    }

    /**
     * Filter the query on the db_order column
     *
     * Example usage:
     * <code>
     * $query->filterByDbOrder(1234); // WHERE db_order = 1234
     * $query->filterByDbOrder(array(12, 34)); // WHERE db_order IN (12, 34)
     * $query->filterByDbOrder(array('min' => 12)); // WHERE db_order > 12
     * </code>
     *
     * @param     mixed $dbOrder The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByDbOrder($dbOrder = null, $comparison = null)
    {
        if (is_array($dbOrder)) {
            $useMinMax = false;
            if (isset($dbOrder['min'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::DB_ORDER, $dbOrder['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($dbOrder['max'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::DB_ORDER, $dbOrder['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::DB_ORDER, $dbOrder, $comparison);
    }

    /**
     * Filter the query on the weight column
     *
     * Example usage:
     * <code>
     * $query->filterByWeight(1234); // WHERE weight = 1234
     * $query->filterByWeight(array(12, 34)); // WHERE weight IN (12, 34)
     * $query->filterByWeight(array('min' => 12)); // WHERE weight > 12
     * </code>
     *
     * @param     mixed $weight The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByWeight($weight = null, $comparison = null)
    {
        if (is_array($weight)) {
            $useMinMax = false;
            if (isset($weight['min'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::WEIGHT, $weight['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($weight['max'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::WEIGHT, $weight['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::WEIGHT, $weight, $comparison);
    }

    /**
     * Filter the query on the code column
     *
     * Example usage:
     * <code>
     * $query->filterByCode('fooValue');   // WHERE code = 'fooValue'
     * $query->filterByCode('%fooValue%'); // WHERE code LIKE '%fooValue%'
     * </code>
     *
     * @param     string $code The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByCode($code = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($code)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $code)) {
                $code = str_replace('*', '%', $code);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::CODE, $code, $comparison);
    }

    /**
     * Filter the query on the desc_pl column
     *
     * Example usage:
     * <code>
     * $query->filterByDescPl('fooValue');   // WHERE desc_pl = 'fooValue'
     * $query->filterByDescPl('%fooValue%'); // WHERE desc_pl LIKE '%fooValue%'
     * </code>
     *
     * @param     string $descPl The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByDescPl($descPl = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($descPl)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $descPl)) {
                $descPl = str_replace('*', '%', $descPl);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::DESC_PL, $descPl, $comparison);
    }

    /**
     * Filter the query on the desc_en column
     *
     * Example usage:
     * <code>
     * $query->filterByDescEn('fooValue');   // WHERE desc_en = 'fooValue'
     * $query->filterByDescEn('%fooValue%'); // WHERE desc_en LIKE '%fooValue%'
     * </code>
     *
     * @param     string $descEn The value to use as filter.
     *              Accepts wildcards (* and % trigger a LIKE)
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByDescEn($descEn = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($descEn)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $descEn)) {
                $descEn = str_replace('*', '%', $descEn);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::DESC_EN, $descEn, $comparison);
    }

    /**
     * Filter the query on the type column
     *
     * Example usage:
     * <code>
     * $query->filterByType(1234); // WHERE type = 1234
     * $query->filterByType(array(12, 34)); // WHERE type IN (12, 34)
     * $query->filterByType(array('min' => 12)); // WHERE type > 12
     * </code>
     *
     * @param     mixed $type The value to use as filter.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByType($type = null, $comparison = null)
    {
        if (is_array($type)) {
            $useMinMax = false;
            if (isset($type['min'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::TYPE, $type['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($type['max'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::TYPE, $type['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::TYPE, $type, $comparison);
    }

    /**
     * Filter the query on the last_modified column
     *
     * Example usage:
     * <code>
     * $query->filterByLastModified('2011-03-14'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified('now'); // WHERE last_modified = '2011-03-14'
     * $query->filterByLastModified(array('max' => 'yesterday')); // WHERE last_modified > '2011-03-13'
     * </code>
     *
     * @param     mixed $lastModified The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByLastModified($lastModified = null, $comparison = null)
    {
        if (is_array($lastModified)) {
            $useMinMax = false;
            if (isset($lastModified['min'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::LAST_MODIFIED, $lastModified['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($lastModified['max'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::LAST_MODIFIED, $lastModified['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::LAST_MODIFIED, $lastModified, $comparison);
    }

    /**
     * Filter the query on the created column
     *
     * Example usage:
     * <code>
     * $query->filterByCreated('2011-03-14'); // WHERE created = '2011-03-14'
     * $query->filterByCreated('now'); // WHERE created = '2011-03-14'
     * $query->filterByCreated(array('max' => 'yesterday')); // WHERE created > '2011-03-13'
     * </code>
     *
     * @param     mixed $created The value to use as filter.
     *              Values can be integers (unix timestamps), DateTime objects, or strings.
     *              Empty strings are treated as NULL.
     *              Use scalar values for equality.
     *              Use array values for in_array() equivalent.
     *              Use associative array('min' => $minValue, 'max' => $maxValue) for intervals.
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function filterByCreated($created = null, $comparison = null)
    {
        if (is_array($created)) {
            $useMinMax = false;
            if (isset($created['min'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::CREATED, $created['min'], Criteria::GREATER_EQUAL);
                $useMinMax = true;
            }
            if (isset($created['max'])) {
                $this->addUsingAlias(EmpevalEvaluationsPeer::CREATED, $created['max'], Criteria::LESS_EQUAL);
                $useMinMax = true;
            }
            if ($useMinMax) {
                return $this;
            }
            if (null === $comparison) {
                $comparison = Criteria::IN;
            }
        }

        return $this->addUsingAlias(EmpevalEvaluationsPeer::CREATED, $created, $comparison);
    }

    /**
     * Filter the query by a related EmpevalEmployeeEvaluations object
     *
     * @param   EmpevalEmployeeEvaluations|PropelObjectCollection $employeeEvaluations  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEvaluationsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEmployeeEvaluations($employeeEvaluations, $comparison = null)
    {
        if ($employeeEvaluations instanceof EmpevalEmployeeEvaluations) {
            return $this
                ->addUsingAlias(EmpevalEvaluationsPeer::ID, $employeeEvaluations->getEvaluationId(), $comparison);
        } elseif ($employeeEvaluations instanceof PropelObjectCollection) {
            return $this
                ->useEmployeeEvaluationsQuery()
                ->filterByPrimaryKeys($employeeEvaluations->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByEmployeeEvaluations() only accepts arguments of type EmpevalEmployeeEvaluations or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the EmployeeEvaluations relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function joinEmployeeEvaluations($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('EmployeeEvaluations');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'EmployeeEvaluations');
        }

        return $this;
    }

    /**
     * Use the EmployeeEvaluations relation EmployeeEvaluations object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalEmployeeEvaluationsQuery A secondary query class using the current class as primary query
     */
    public function useEmployeeEvaluationsQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinEmployeeEvaluations($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'EmployeeEvaluations', 'EmpevalEmployeeEvaluationsQuery');
    }

    /**
     * Filter the query by a related EmpevalEmployeeEvaluationValues object
     *
     * @param   EmpevalEmployeeEvaluationValues|PropelObjectCollection $employeeEvaluationValues  the related object to use as filter
     * @param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL
     *
     * @return   EmpevalEvaluationsQuery The current query, for fluid interface
     * @throws   PropelException - if the provided filter is invalid.
     */
    public function filterByEmployeeEvaluationValues($employeeEvaluationValues, $comparison = null)
    {
        if ($employeeEvaluationValues instanceof EmpevalEmployeeEvaluationValues) {
            return $this
                ->addUsingAlias(EmpevalEvaluationsPeer::ID, $employeeEvaluationValues->getEvaluationId(), $comparison);
        } elseif ($employeeEvaluationValues instanceof PropelObjectCollection) {
            return $this
                ->useEmployeeEvaluationValuesQuery()
                ->filterByPrimaryKeys($employeeEvaluationValues->getPrimaryKeys())
                ->endUse();
        } else {
            throw new PropelException('filterByEmployeeEvaluationValues() only accepts arguments of type EmpevalEmployeeEvaluationValues or PropelCollection');
        }
    }

    /**
     * Adds a JOIN clause to the query using the EmployeeEvaluationValues relation
     *
     * @param     string $relationAlias optional alias for the relation
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function joinEmployeeEvaluationValues($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        $tableMap = $this->getTableMap();
        $relationMap = $tableMap->getRelation('EmployeeEvaluationValues');

        // create a ModelJoin object for this join
        $join = new ModelJoin();
        $join->setJoinType($joinType);
        $join->setRelationMap($relationMap, $this->useAliasInSQL ? $this->getModelAlias() : null, $relationAlias);
        if ($previousJoin = $this->getPreviousJoin()) {
            $join->setPreviousJoin($previousJoin);
        }

        // add the ModelJoin to the current object
        if ($relationAlias) {
            $this->addAlias($relationAlias, $relationMap->getRightTable()->getName());
            $this->addJoinObject($join, $relationAlias);
        } else {
            $this->addJoinObject($join, 'EmployeeEvaluationValues');
        }

        return $this;
    }

    /**
     * Use the EmployeeEvaluationValues relation EmployeeEvaluationValues object
     *
     * @see       useQuery()
     *
     * @param     string $relationAlias optional alias for the relation,
     *                                   to be used as main alias in the secondary query
     * @param     string $joinType Accepted values are null, 'left join', 'right join', 'inner join'
     *
     * @return   EmpevalEmployeeEvaluationValuesQuery A secondary query class using the current class as primary query
     */
    public function useEmployeeEvaluationValuesQuery($relationAlias = null, $joinType = Criteria::LEFT_JOIN)
    {
        return $this
            ->joinEmployeeEvaluationValues($relationAlias, $joinType)
            ->useQuery($relationAlias ? $relationAlias : 'EmployeeEvaluationValues', 'EmpevalEmployeeEvaluationValuesQuery');
    }

    /**
     * Exclude object from result
     *
     * @param   EmpevalEvaluations $evaluations Object to remove from the list of results
     *
     * @return EmpevalEvaluationsQuery The current query, for fluid interface
     */
    public function prune($evaluations = null)
    {
        if ($evaluations) {
            $this->addUsingAlias(EmpevalEvaluationsPeer::ID, $evaluations->getId(), Criteria::NOT_EQUAL);
        }

        return $this;
    }

}
